Xbasic
{On_Clipboard_Change}
Syntax
{On_Clipboard_Change= Event_Name }
Arguments
- Event_Name
The name of an event in the Xdialog script.
Description
Fires an event when the Clipboard contents change.
Example
dim clipb as C = ""
clipb = ""
dlg_title = "Clipboard watcher"
ui_modeless_dlg_box(dlg_title,<<%dlg%
{on_clipboard_change=clip}
[%M%.50,30clipb];
<&Close!close>
%dlg%,<<%code%
if a_dlg_button = "close" .or. a_dlg_button = "" then
a_dlg_button = ""
ui_modeless_dlg_close(dlg_title)
else if a_dlg_button = "clip"
a_dlg_button = ""
if clipboard.Has_Data()You only want to respond to clipboard events if text was placed onto the clipboard. If, for example, a bitmap was placed on the clipboard, you want to ignore it. clipboard.Has_Data()(with no arguments) will return TRUE (.T.) if the clipboard contains text.
clipb = clipboard.Get_Data()+crlf()+replicate("=",30)+crlf()+clipb
end if
end if
%code%)Limitations
Desktop applications only
See Also